#pragma once

#include <AVUIButton.h>
#include <AVUIRoutedEventArgs.h>

namespace AVUI {


class Uri;
class RequestNavigateEventArgs : public RoutedEventArgs
{
public:

    DECLARE_ELEMENT(RequestNavigateEventArgs, RoutedEventArgs);

    RequestNavigateEventArgs(RoutedEvent* pRoutedEvent, Uri* pUri, String* pTarget) : RoutedEventArgs(pRoutedEvent), m_pUri(pUri), m_pTarget(pTarget) { }

    const String* get_Target() const { return m_pTarget; }
    const Uri* get_Uri() const { return m_pUri; }

private:
    TRefCountedPtr<String> m_pTarget;
    TRefCountedPtr<Uri> m_pUri;
};



class NavButton : public Button
{
public:
    NavButton() { };
    ~NavButton() { };

    DECLARE_ELEMENT(NavButton, Button);

    DECLARE_DEPENDENCY_PROPERTY(NavigateUri);
    TRefCountedPtr<Uri> get_NavigateUri() { return (Uri*)(Object*)GetValue(get_NavigateUriProperty()); }
    void set_NavigateUri(Uri* pValue) { return SetValue(get_NavigateUriProperty(), (Object*)pValue); }

    DECLARE_DEPENDENCY_PROPERTY(TargetName);
    TRefCountedPtr<String> get_TargetName() { return (String*)(Object*)GetValue(get_TargetNameProperty()); }
    void set_TargetName(String* pValue) { return SetValue(get_TargetNameProperty(), (Object*)pValue); }

    IMPLEMENT_ROUTED_EVENT(RequestNavigate,  RequestNavigateEventArgs, RoutingStrategy::Bubble);

protected:

    virtual void OnClick();

private:
    static void StaticConstructor();
};

}; // namespace AVUI
